﻿Public Class KhoiDAO
    Public Shared Function SelectAll() As List(Of KhoiDTO)
        Const strSql As String = "select * from KHOI"
        Dim ds = New List(Of KhoiDTO)
        Using db = New SQLProvider()
            Using re = db.ExecuteReader(strSql)
                While re.Read()
                    Dim obj = New KhoiDTO
                    obj.MAKHOI = re.GetInt32(0)
                    obj.TENKHOI = re.GetString(1)
                    ds.Add(obj)
                End While
            End Using
        End Using

        Return ds
    End Function
End Class
